import { Layout } from "antd"
import ConnList from "./ConnList"
import type { RedisClient } from "@linksaas-minapp/redis-proxy-api"
import { useState } from "react";
import Content from "./Content";

function App() {

  const [curClient, setCurClient] = useState<RedisClient | null>(null);

  return (
    <Layout hasSider style={{ height: "100vh" }}>
      <Layout.Sider width={"200px"} theme="light">
        <ConnList onChange={client => setCurClient(client)} />
      </Layout.Sider>
      <Layout.Content>
        <Content client={curClient}/>
      </Layout.Content>
    </Layout>
  )
}

export default App
